package cn.group.controller;

import cn.group.mapper.PermissionMapper;
import cn.group.service.PermissionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;
import pojo.entity.Permission;
import utils.BaseController;

import javax.servlet.http.HttpServletResponse;
import java.util.List;

@Api(tags = "权限信息")
@RestController
@RequestMapping(value = "/permission", produces = "text/html;charset=UTF-8")
public class PermissionController extends BaseController {

    @Autowired
    PermissionService permissionService;

    @ApiOperation("查询权限")
    @RequestMapping("/findAllPermission.do")
    @ResponseBody
    public String findAllPermission(HttpServletResponse response){
        List<Permission> allPermission = permissionService.findAllPermission();
        System.out.println(allPermission);
        String result = writerSuccessResult(allPermission, response);
        return result;
    }
}
